﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 双向绑定2改进再改进
{
    public partial class Form2 : Form
    {
        private Data _data;
        public Form2()
        {
            InitializeComponent();
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            _data = Data.Ins;
            textBox1.DataBindings.Add("Text", _data, "String1", false, DataSourceUpdateMode.OnPropertyChanged);
            textBox2.DataBindings.Add("Text", _data, "String2", false, DataSourceUpdateMode.OnPropertyChanged);
        }
    }
}
